import sys
class Screen:
    def __init__(self,width=640, height=480):
        self.width = width
        self.height = height
        if (0<self.width <=1000 and 0<self.height<=1000):
            print("screen")
        else:
            print("invalid screen size")
            sys.exit()
class Rectangle(Screen):
    def __init__(self,x1=0, y1=0, x2=0, y2=0, t='None'):
        self.x1 = x1
        self.y1 = y1
        self.x2 = x2
        self.y2 = y2
        self.t = t
        print("rectangle")

    def set_coordinations(self, x1=0, y1=0, x2=0, y2=0):
        self.x1 = x1
        self.y1 = y1
        self.x2 = x2
        self.y2 = y2

    def set_screen(self, x):
        self.t = x

    def draw(self):
        width = abs(self.x2 - self.x1)
        height = abs(self.y2 - self.y1)
        if (0<self.t.height <height and 0<self.t.width < width):
            print(self.x1, end=" ")
            print(self.y1, end=" ")
            print(width, end=" ")
            print(height)
        else:
            print("invalid rectangle")

    def set_screen(self, x):
        self.t = x

    def draw(self):
        width = self.x2 - self.x1
        height = self.y2 - self.y1
        if (0<self.t.height <height and 0<self.t.width < width):
            print(self.x1, end=" ")
            print(self.y1, end=" ")
            print(width, end=" ")
            print(height)

        else:
            print("invalid rectangle")
